package com.example.zlx.service.impl;

import com.example.zlx.entity.Zonghe;
import com.example.zlx.repository.ZongheRepository;
import com.example.zlx.service.ZongheService;
import com.example.zlx.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ZongheServiceImpl implements ZongheService{
    @Autowired
    private ZongheRepository zongheRepository;
    @Override
    public ServerResponse<Zonghe> getPlumberById(Integer id) {
        Zonghe  zongheInfo=zongheRepository.findOne(id);
        if( zongheInfo==null){
            return ServerResponse.createByErrorMessage("没有相应的id");
        }
        return ServerResponse.createBySuccess("查找成功", zongheInfo);
    }

    @Override
    public ServerResponse list() {
        return null;
    }
}
